home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / git-4.3 / git-4 / git-4.3.7 / src / gitrgrep < prev    next >
Encoding:
Text File  |  1995-07-08  |  1.3 KB  |  45 lines

  1.  
  2. ###############################################################################
  3. #                                                                             #
  4. #               GNU Interactive Tools 4.3.7 recursive grep script             #
  5. #               Copyright (C) 1994 Free Software Foundation, Inc.             #
  6. #                   Written by Tudor Hulubei and Andrei Pitis.                #
  7. #                                                                             #
  8. ###############################################################################
  9.  
  10. #
  11. # /bin/sh should support functions in order to run this script.
  12. # Use bash to be sure. Since few systems have bash as /bin/sh, I
  13. # didn't put #!/bin/sh at the begining of this file.
  14. #
  15. # Standard Bourne shell users should delete the function keyword.
  16. #
  17.  
  18. function parse
  19. {
  20. #    set -xv
  21.  
  22. #   Thanks to Han Holl for removing the space between -c and $skip
  23.     echo "."`pwd | cut -c$skip-`"/:"
  24.  
  25.     grep $p1 $p2 $p3 $p4 $p5 $p6 $p7 $p8 $p9 2> /dev/null
  26.  
  27.     for i in * .*
  28.     do
  29.         if [ -d $i -a $i != "." -a $i != ".." ]
  30.         then
  31.             cd $i
  32.             parse
  33.             cd ..
  34.         fi
  35.     done
  36. }
  37.  
  38.  
  39. p1="$1";p2="$2";p3="$3";p4="$4";p5="$5";p6="$6";p7="$7";p8="$8";p9="$9"
  40.  
  41. # Thanks to Han Holl for adding the sed pipe
  42. skip=`pwd | wc -c | sed 's/ //g'`
  43.  
  44. parse
  45.